This invention relates to macroblock coding, and more particularly relates to macroblock pair coding for both progressive and interlaced data.
Predictive coding is a technique widely used in video transmission to reduce the picture size after encoding. Typically, a frame is divided into a plurality of blocks known as macroblocks. When coding a current macroblock of a current frame, information from one or more reference frames is utilized to code the current macroblock in the current frame. A search over a certain area of the reference frame is performed to find the best matching block with the least prediction error. Therefore, for each current macroblock coding operation, information from reference frames will be re-utilized.
Conventional coding systems temporally store the video data to a dynamic storage such as a DRAM. When coding a current macroblock, the macroblock and the search window for coding the macroblock are uploaded from the DRAM to an SRAM. As the search windows for adjacent macroblocks will have some overlap area, only the non-overlapped area needs to be uploaded to the SRAM. Furthermore, there are two commonly used levels of data re-use: Level C and Level D. As these methods are well known in the art they will not be described here. For further background information please refer to “On the data reuse and memory bandwidth analysis for full-search block-matching VLSI architecture,” IEEE Transactions on Circuits and Systems for Video Technology, vol. 12, no. 1, pp. 61-72, January 2002 by J. C. Tuan, T. S. Chang, and C. W. Jen. If Level C re-use is implemented, only a small SRAM is required. The DRAM bandwidth, however, is affected strongly. For Level D re-use, a large SRAM is required, but less DRAM bandwidth is utilized than for Level C.
For example, taking a macroblock as 16×16 pixels with two reference frames and search range equal to H±64 V±32, and assuming the video format is 1280×720×30 Hz, for a Level C data re-use, each time a macroblock is encoded, an area of 16×80 pixels per reference frame is loaded from the DRAM to the SRAM. The total size of a search window per reference frame is equal to 144×80 pixels. A total required size of the SRAM for Level C data re-use is 23,040 bytes. For Level D, however, a search window is far larger as it utilizes entire rows in the reference frame. Therefore a required size of the SRAM for Level D data re-use is 204,800 bytes. When SRAM expense is a consideration, Level C is clearly more desirable. When DRAM bandwidth is taken into consideration, however, Level D data re-use is much more efficient as it does not require constant heavy loading of data to the SRAM. In the case of real-time processing for 1280×720×30 Hz videos, the DRAM bandwidth for Level C data re-use is 276,480,000 bytes per second, whereas for Level D data re-use it is only 55,296,000 bytes per second.
There is therefore a trade-off between DRAM efficiency and SRAM expense. This may result in situations where both methods of data re-use cannot be applied.